<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<h:head>
        <title>Ferramenta de Requisitos</title>
</h:head>
<h:body>    
<table>
<tr>
<td>
<h:form>
    <p:panel id="paneltr" header="Tipo de Requisito">  
        <p:messages />  
        <h:panelGrid columns="2">  
            <h:outputLabel for="nome" value="Nome: *" />  
             <p:inputText id="nome" value="#{CadastrarTipoRequisitoBean.tiporequisito.nome}" required="true"/>  
              
            <h:outputLabel for="abreviatura" value="Abreviatura: *"  />  
             <p:inputText id="abreviatura" value="#{CadastrarTipoRequisitoBean.tiporequisito.abreviatura}" required="true"/>  
        
            <h:outputLabel for="descricao" value="DescriÃ§Ã£o: *" />           
            <p:inputTextarea id="descricao" value="#{CadastrarTipoRequisitoBean.tiporequisito.descricao}" rows="4" cols="10"
                               maxlength="#300" styleClass="input_field"
                               style="height:90px;vertical-align:top;" effectDuration="400">
            </p:inputTextarea>
        </h:panelGrid>
        <p:commandButton id = "CadTpReq2" value = "Cadastrar Tipo de Requisito2" action="#{CadastrarTipoRequisitoBean.cadreq}"/>
    </p:panel>
</h:form>  
</td>
</tr>
<tr>
<td>
<h:form>
   <p:panel id="panelatr" header="Atributo">  
        <p:messages />  
        <h:panelGrid columns="2">  
            <h:outputLabel for="nomeatr" value="Nome: *" />  
             <p:inputText id="nomeatr" value="#{CadastrarTipoRequisitoBean.atributoAtual.nome}" required="true"/>  
              
            <h:outputLabel for="pesoatr" value="Peso: *"  />  
             <p:inputText id="pesoatr" value="#{CadastrarTipoRequisitoBean.atributoAtual.peso}" required="true"/>  
        
            <h:outputLabel for="descricaoatr" value="DescriÃ§Ã£o: *" />           
            <p:inputTextarea id="descricaoatr" value="#{CadastrarTipoRequisitoBean.atributoAtual.descricao}" rows="4" cols="10"
                               maxlength="#300" styleClass="input_field"
                               style="height:90px;vertical-align:top;" effectDuration="400">
            </p:inputTextarea>
        </h:panelGrid>  
        <p:commandButton value="Adicionar Atributo" actionListener="#{CadastrarTipoRequisitoBean.adicionarAtributo}" oncomplete="parent.location='CadastroDeRequisitos.xhtml'"/>
    	<p:commandButton value="Excluir Atributo" actionListener="#{CadastrarTipoRequisitoBean.excluirAtributo}" oncomplete="parent.location='CadastroDeRequisitos.xhtml'"/>
    	<p:commandButton id = "Imprimir" value = "Imprimir" action="#{CadastrarTipoRequisitoBean.imprimir}"/>
    	<p:commandButton id = "Criar" value = "Criar" actionListener="#{CadastrarTipoRequisitoBean.criar}" oncomplete="parent.location='CadastroDeRequisitos.xhtml'"/>
    	<p:commandButton id = "CadTpReq" value = "Cadastrar Tipo de Requisito" action="#{CadastrarTipoRequisitoBean.cadastrarTipoRequisito}"/>
    </p:panel>  
</h:form>  
</td>
<td>
<h:form>   
    <p:dataTable id="resultado" var="atributo" value="#{CadastrarTipoRequisitoBean.atributos}"  selection="#{CadastrarTipoRequisitoBean.atributoRem}" selectionMode="single">  
        
        <p:column>  
            <f:facet name="header">  
                    Nome  
            </f:facet>  
            <h:outputText value="#{atributo.nome}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                    Peso  
            </f:facet>  
            <h:outputText value="#{atributo.peso}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                    DescriÃ§Ã£o  
            </f:facet>  
            <h:outputText value="#{atributo.descricao}" />  
        </p:column>  
    </p:dataTable>
</h:form>
</td>
</tr>
</table> 				
</h:body>                
</html>